package xmarti.vacaxm.beans.maintenance;

import java.util.Objects;

public class Area implements java.io.Serializable{
	private int id;
	private String code;
	private String name;
	public Area (){};
	public Area( String code, String name) {
		super();		
		this.code = code;
		this.name = name;
	}
	/**
	 * @return the id
	 */
	public int getId() {
		return id;
	}
	/**
	 * @param id the id to set
	 */
	public void setId(int id) {
		this.id = id;
	}
	/**
	 * @return the code
	 */
	public String getCode() {
		return code;
	}
	/**
	 * @param code the code to set
	 */
	public void setCode(String code) {
		this.code = code;
	}
	/**
	 * @return the name
	 */
	public String getName() {
		return name;
	}
	/**
	 * @param name the name to set
	 */
	public void setName(String name) {
		this.name = name;
	}

    @Override
    public int hashCode() {
        int hash = 3;
        hash = 83 * hash + Objects.hashCode(this.code);
        return hash;
    }

    @Override
    public boolean equals(Object obj) {
        if (obj == null) {
            return false;
        }
        if (!(obj instanceof Area)) {
            return false;
        }
        final Area other = (Area) obj;
        if (!Objects.equals(this.code, other.code)) {
            return false;
        }
        return true;
    }
	
        @Override
        public String toString (){
		return this.code;
	}
        public String toText(){
            return this.code +"-"+this.name; 
        }
}
